#ifndef _TIMER_NODE_CPP_
#define _TIMER_NODE_CPP_

#include "Timer_Node.h"

template <class TYPE>
Timer_Node<TYPE>::Timer_Node(void)
{}

template <class TYPE>
Timer_Node<TYPE>::~Timer_Node(void)
{}

template <class TYPE> inline 
void Timer_Node<TYPE>::set (const TYPE &type,
							 const void *arg,
							 unsigned long timer_value,
							 unsigned long interval,
							 unsigned long timer_id,
							 Timer_Node<TYPE>* next )
{
	this->type_ = type;
	this->acg_ = arg;
	this->timer_value_ = timer_value;
	this->interval_ = interval;
	this->timer_id_ = timer_id;
	this->next_ = next;
}

template <class TYPE> inline 
void Timer_Node<TYPE>::set(const TYPE &type,
						   const void *arg, 
						   unsigned long time_value, 
						   unsigned long interval, 
						   unsigned long timer_id, 
						   Timer_Node<TYPE> *prev, 
						   Timer_Node<TYPE> *next)
{
	this->type_ = type;
	this->acg_ = arg;
	this->timer_value_ = timer_value;
	this->interval_ = interval;
	this->timer_id_ = timer_id;
	this->prev_ = prev;
	this->next_ = next;
}

template <class TYPE> inline
TYPE& Timer_Node<TYPE>::get_type (void)
{
	return this->type_;
}

template <class TYPE> inline
void Timer_Node<TYPE>::set_type (TYPE &type)
{
	this->type_ = type;
}

template <class TYPE> inline 
const void * Timer_Node<TYPE>::get_arg (void)
{
	return this->arg;
}

template <class TYPE> inline 
void Timer_Node<TYPE>::set_arg (void *acg)
{
	this->acg_ = acg;
}

template <class TYPE> inline
unsigned long Timer_Node<TYPE>::get_timer_value (void) const
{
	return this->timer_value_;
}

template <class TYPE> inline 
void Timer_Node<TYPE>::set_timer_value (unsigned long timer_value)
{
	this->timer_value_ = timer_value;
}

template <class TYPE> inline 
unsigned long Timer_Node<TYPE>::get_interval (void) const
{
	return this->interval_;
}

template <class TYPE> inline 
void Timer_Node<TYPE>::set_interval (unsigned long interval)
{
	this->interval_ = interval;
}

template <class TYPE> inline 
Timer_Node<TYPE>* Timer_Node<TYPE>::get_prev (void) 
{
	return this->prev_;
}

template <class TYPE> inline 
void Timer_Node<TYPE>::set_prev (Timer_Node<TYPE> *prev)
{
	this->prev_ = prev;
}

template <class TYPE> inline 
Timer_Node<TYPE>* Timer_Node<TYPE>::get_next (void)
{
	return this->next_;
}

template <class TYPE> inline 
void Timer_Node<TYPE>::set_next (Timer_Node<TYPE> *next)
{
	this->next_ = next;
}

template <class TYPE> inline 
long Timer_Node<TYPE>::get_timer_id (void) const
{
	return this->timer_id_;
}

template <class TYPE> inline 
void Timer_Node<TYPE>::set_timer_id (long timer_id)
{
	this->timer_id_ = timer_id;
}

template <class TYPE> inline 
void Timer_Node<TYPE>::on_timer_out(unsigned long curtime )
{
	this->type_->on_timer_out( this->timer_id_,
										curtime,
										this->arg_);
}

template <class TYPE> inline 
void Timer_Node<TYPE>::on_timer_cancel()
{
	this->type_->on_timer_cancel(this->timer_id_, this->arg_);
}
#endif//_TIMER_NODE_CPP_